﻿using S.Common.helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static S.Common.EditReproductivePresenceStateHelper.EditReproductivePresenceState;

namespace S.Common.EditReproductivePresenceStateHelper
{
    public class EditReproductivePresenceState
    {
        public class SheepFileUpdateState
        {
            /// <summary>
            /// 可视耳标
            /// </summary>
            public string EarTag { get; set; }
            /// <summary>
            /// 修改标识
            /// </summary>

            public int Uflag { get; set; }
            /// <summary>
            /// 修改状态
            /// </summary>
            public int UState { get; set; }

            /// <summary>
            /// 繁殖状态开始日期
            /// </summary>
            public DateTime? ReproductiveStateDate { get; set; }
        }
        /// <summary>
        /// 修改繁殖状态流转状态
        /// </summary>
        /// <param name="EarTag"></param>
        /// <param name="Uflag"></param>
        /// <param name="UState"></param>
        /// <returns></returns>
        public static string UpdateReproductivePresenceState(string EarTag,int Uflag,int UState,DateTime? ReproductiveStateDate,string Gateway)
        {
            SheepFileUpdateState sheepFileUpdateState = new SheepFileUpdateState()
            {
                EarTag = EarTag,
                Uflag = Uflag,
                UState = UState,
                ReproductiveStateDate= ReproductiveStateDate
            };
            var result = HttpClientHelper.PutDataResponse(Gateway+"/achs/api/SheepFileModel/SheepFileUpdateState", sheepFileUpdateState);
            return result;
        }
        public class SheepFileUpdateStatePL
        {
            /// <summary>
            /// 可视耳标
            /// </summary>
            public List<string> EarTag { get; set; }
            /// <summary>
            /// 修改标识
            /// </summary>

            public int Uflag { get; set; }
            /// <summary>
            /// 修改状态
            /// </summary>
            public int UState { get; set; }
        }
        /// <summary>
        /// 批量繁殖状态流转状态
        /// </summary>
        /// <param name="EarTag"></param>
        /// <param name="Uflag"></param>
        /// <param name="UState"></param>
        /// <returns></returns>
        public static string UpdateReproductivePresenceStatePL(List<string> EarTag,int Uflag,int UState, string Gateway)
        {
            SheepFileUpdateStatePL sheepFileUpdateStatePL = new SheepFileUpdateStatePL()
            {
                EarTag= EarTag,
                UState= UState,
                Uflag= Uflag,
            };
            var result = HttpClientHelper.PutDataResponse(Gateway+"/achs/api/SheepFileModel/SheepFileUpdateStatePL", sheepFileUpdateStatePL);
            return result;
        }
    }
}
